import 'package:flutter_model_package/parse_base.dart';
import 'package:parse_server_sdk/parse_server_sdk.dart';

import 'CourseCategory.dart';

class Course extends MSParseBase {
  Course() : super("Course");

  Course.cloe() : this();

  @override
  Course clone(Map<String, dynamic> map) => Course.cloe()..fromJson(map);

  QueryBuilder<Course> getCourse() {
    return QueryBuilder(this)..includeObject(['category']);
  }

  /// 获得单个课程分类信息
  QueryBuilder<Course> getForCategory(CourseCategory category) {
    return QueryBuilder(this)..whereEqualTo("category", category);
  }

  /// 获得全部分类课程信息
  QueryBuilder<Course> getAllCategory(
      QueryBuilder categoryquery) {
    return QueryBuilder(this)..whereMatchesQuery("category", categoryquery);
  }
}
